﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="messagebox.aspx.cs" Inherits="ncp.Web.page.messagebox" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="/css/page.css" rel="stylesheet" type="text/css" />
    <link href="../css/module.css" rel="stylesheet" type="text/css" />

    <script src="/js/jquery-1.7.2.min.js" type="text/javascript"></script>

    <script src="../js/common.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width: 450px;height:220px;font-size:12px;margin:10px;">
        <table style="border: none;">
            <tr>
                <td style="width: 80px;">姓名：</td>
                <td><input type="text" id="username" class="bh-input-long"  maxlength="20"/></td>
            </tr>
            <tr>
                <td> 留言内容：</td>
                <td><textarea class="msgContent" id="msgContent"></textarea></td>
            </tr>
            <tr>
                <td> 您的电话：</td>
                <td><input name="" type="text" id="userPhone" class="bh-input-long" maxlength="20"/></td>
          </tr>
          <tr>
                <td>您的邮件：</td>
                <td><input name="" type="text" id="userEmail" class="bh-input-long" maxlength="50"/></td>
          </tr>
          <tr>
            <td> 验证码：</td>
            <td>
                <input type="text" class="required bh-input-small" id="tbcode"/>
                <img id="checkImage" src="/work/VerificationCode.aspx" width="93" height="25"  alt="验证码"　title="验证码" />
                看不清 <span class="bh-blue bh-udline" style="cursor:pointer;" onclick="onfresh()" id="check" >换一张</span>
			</td>
          </tr>
        </table>
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    function onfresh() {
        var rand = Math.random() * 1000;
            $("#checkImage").attr("src", "/work/VerificationCode.aspx?" + rand);
        }
        //判断数据
        function checkData() {
            if (getByteLen($("#username").val()) == 0) {
                alert("姓名不能为空!");
                $("#username").focus();
                return false;
            }
            if (getByteLen($("#username").val()) > 50) {
                alert("姓名长度不能超过50个字符!");
                $("#username").focus();
                return false;
            }
            if (getByteLen($("#msgContent").val()) == 0) {
                alert("留言内容不能为空!");
                $("#msgContent").focus();
                return false;
            }
            if (getByteLen($("#msgContent").val()) > 200) {
                alert("留言内容长度不能超过200个字符!");
                $("#msgContent").focus();
                return false;
            }
            if (getByteLen($("#userPhone").val()) == 0) {
                alert("电话号码不能为空!");
                $("#userPhone").focus();
                return false;
            }
            if (getByteLen($("#userPhone").val()) > 20) {
                alert("电话号码过长!");
                $("#userPhone").focus();
                return false;
            }
            if (getByteLen($("#userEmail").val()) > 50) {
                alert("邮件地址过长!");
                $("#userEmail").focus();
                return false;
            }
            if (!isEmail($("#userEmail").val())) {
                alert("邮箱地址不正确!");
                $("#userEmail").focus();
                return false;
            }
            if (isEmpty("tbcode")) {
                alert("验证码不能为空!");
                $("#tbcode").focus();
                return false;
            }
            return true;
        }
</script>